package com.lihan.GetSeatInLib.Domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.lihan.GetSeatInLib.Domain.Enums.CredtRank;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 
 * @ClassName: User
 * @Description: 用户类
 * @author ASUS
 * @date 2022年1月9日
 *
 */
@Entity
@ApiModel(value = "用户模型User")
@Table(name = "t_user")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer"})
public class User{
	
	
	/**
	 * 用户ID
	 */
	@ApiModelProperty(value = "用户ID")
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "user_id")
	private long ID;
	
	
	/**
	 * 用户名
	 */
	@ApiModelProperty(value = "用户名UserName")
	@Column(name = "user_name",length = 25,unique = true)
	private String UserName;
	/**
	 * 密码
	 */
	@ApiModelProperty(value = "密码password")
	@Column(name = "user_pwd",length = 50)
	private String Password;
	/**
	 * 手机号
	 */
	@ApiModelProperty(value = "用户手机号码")
	@Column(name = "user_phone",length = 15)
	private String PhoneNumber;
	/**
	 * 邮箱
	 */
	@ApiModelProperty(value = "用户email")
	@Column(name = "user_email",unique = true,length = 40)
	private String Email;
	/**
	 * 性别
	 */
	@ApiModelProperty(value = "用户性别")
	@Column(name = "user_sex")
	private boolean sex;
	/**
	 * 学号
	 */
	@ApiModelProperty(value = "用户学号")
	@Column(name = "user_studentID",unique = true,length = 20)
	private String StudentID;
	/**
	 * 头像路径
	 */
	@ApiModelProperty(value = "用户头像路径")
	@Column(name = "user_path",length = 100)
	private String IconPath;
	/**
	 * 登记
	 */
	@ApiModelProperty(value = "用户等级")
	@Column(name = "user_grade")
	private long Grade;
	/**
	 * 信用
	 */
	@ApiModelProperty(value = "用户信用等级")
	@Column(name = "user_rank")
	private CredtRank rank;

	/**
	 * 角色
	 */
	@ApiModelProperty(value = "用户角色")
	@Column(name = "user_role",length = 32)
	private String Role;
	
	
	
	
	
	

	public User(long iD, String userName, String password, String phoneNumber, String email, boolean sex,
			String studentID, String iconPath,CredtRank rank, long grade, String role) {
		ID = iD;
		UserName = userName;
		Password = password;
		PhoneNumber = phoneNumber;
		Email = email;
		this.sex = sex;
		StudentID = studentID;
		IconPath = iconPath;
		Grade = grade;
		this.rank = rank;
		Role = role;
	}



	public User() {
		
	}



	public String getIconPath() {
		return IconPath;
	}

	public void setIconPath(String iconPath) {
		IconPath = iconPath;
	}

	public long getGrade() {
		return Grade;
	}

	public void setGrade(long grade) {
		Grade = grade;
	}

	public long getID() {
		return ID;
	}

	public void setID(long iD) {
		ID = iD;
	}

	public String getUserName() {
		return UserName;
	}

	public void setUserName(String userName) {
		UserName = userName;
	}

	public String getPhoneNumber() {
		return PhoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		PhoneNumber = phoneNumber;
	}

	public String getEmail() {
		return Email;
	}

	public void setEmail(String email) {
		Email = email;
	}

	public boolean isSex() {
		return sex;
	}

	public void setSex(boolean sex) {
		this.sex = sex;
	}

	public String getStudentID() {
		return StudentID;
	}

	public void setStudentID(String studentID) {
		StudentID = studentID;
	}

	public CredtRank getRank() {
		return rank;
	}

	public void setRank(CredtRank rank) {
		this.rank = rank;
	}

	public String getPassword() {
		return Password;
	}

	public void setPassword(String password) {
		Password = password;
	}
	
	public String getRole() {
		return Role;
	}



	public void setRole(String role) {
		Role = role;
	}



	@Override
	public String toString() {
		return "User [ID=" + ID + ", UserName=" + UserName + ", Password=" + Password + ", PhoneNumber=" + PhoneNumber
				+ ", Email=" + Email + ", sex=" + sex + ", StudentID=" + StudentID + ", IconPath=" + IconPath + "]";
	}

	

}
